import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/ExamContent/Get',
    method: 'post',
    data: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/api/ExamContent/Get/' + id,
    method: 'get'
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) {
  return request({
    url: '/api/ExamContent/post',
    method: 'post',
    data
  })
}

export function updateArticle(id, data) {
  return request({
    url: '/api/ExamContent/Put/' + id,
    method: 'put',
    data
  })
}
export function getCategory() {
  return request({
    url: '/api/Nav/GetNavData',
    method: 'get'
  })
}
